package org.lds.ers.client.widgets;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.VerticalPanel;

public class MaintainResume extends VerticalPanel {
	private static MaintainResume singleton;
	public static MaintainResume getInstance()
	{
		if (singleton==null)
			singleton = new MaintainResume();
		
		return singleton;
	}
	
	final Label lblBanner;
	final HorizontalPanel pnlTitle ;
	final VerticalPanel pnlResumeList;
	final ListBox cboWard;
	
	
	private MaintainResume() {
		this.lblBanner = new Label("[[維護履歷表]]");
		this.add(this.lblBanner);
		
		this.pnlTitle = new HorizontalPanel();
		this.add(this.pnlTitle);
		this.pnlResumeList = new VerticalPanel();
		this.add(this.pnlResumeList);
		
		//Add title components
		final Label lblUnit = new Label("支/分會");
		this.pnlTitle.add(lblUnit);
		cboWard = new ListBox(false);
		this.pnlTitle.add(cboWard);
		this.pnlTitle.add(new Label("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"));
		final Button btnAddNew = new Button("新增履歷");
		this.pnlTitle.add(btnAddNew);
		
		btnAddNew.addClickHandler(new ClickHandler() {
			public void onClick(ClickEvent event) {
				MaintainResumeSForm.getInstance().show();
				
			}
		});
		
		refreshMyWards();
		
	}
	
	public void refreshMyWards()
	{
		this.cboWard.clear();
		
	}
	
	private void refreshResumeList() {
		
	}
}
